package com.team.lostProperty.controller;


import com.team.lostProperty.entity.Admin;
import com.team.lostProperty.entity.Result;
import com.team.lostProperty.service.AdminService;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;



@RestController
@RequestMapping("/admin")
public class AdminController {

    @Resource
    private AdminService adminService;

    @CrossOrigin
    @RequestMapping("/list")
    public Result selectList(@RequestParam String username) {
        System.out.println(username);
        Result result=new Result();
        result.setCode(0);
        result.setMsg("成功");
        List<Admin> admins = adminService.selectList();
        result.setData(admins);
        return result;
    }

}
